package com.medica.ledproject.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @author xiaona
 * @date 2024/5/29
 * @description 文字样式
 */
@Data
public class FontStyle  implements Serializable {
    @Schema(description = "字体" , example = "Arial")
    String fontName;
    @Schema(description = "字体大小")
    int fontSize;
    @Schema(description = "字体颜色")
    String fontColor;
    @Schema(description = "背景色")
    String bgColor;
    @Schema(description = "对齐方式")
    int verticalAlignment=0;
    @Schema(description = "对齐方式")
    int horizontalAlignment=0;

    public int getFontSize() {
        return fontSize>0?fontSize:12;
    }

    public String getFontName() {
        return StringUtils.isEmpty(fontName)?"宋体":fontName;
    }

    public String getFontColor() {
        return StringUtils.isEmpty(fontColor)?"#FF0000":fontColor;
    }

    public String getBgColor() {
        return StringUtils.isEmpty(bgColor)?"#000000":bgColor;
    }

    public int getVerticalAlignment() {
        return verticalAlignment>0?verticalAlignment:0;
    }

    public int getHorizontalAlignment() {
        return horizontalAlignment>0?horizontalAlignment:0;
    }
}
